public class lk6255 {
    public int minScore(int n, int[][] roads) {
        int e =roads.length;
        int min=10000000;
        int all=0;
        int a[]=new int[10000];
        for(int i=0;i<n;i++){
            if(roads[i][1]!=0){
                a[i]=-1;
            }
        }
        for(int i=0;i<e;i++){
            if(roads[i][2]<min){
                min= roads[i][2];
            }
        }
        return min;
    }
}
